import 'lib_apple_auth_storage_platform_interface.dart';

class LibAppleAuthStorage {
  static const String prefix_file = "kai_private_key"; // 私钥文件的前缀
  static Future<String?> getPlatformVersion() {
    return LibAppleAuthStoragePlatform.instance.getPlatformVersion();
  }

  static Future<AppleLoginResult?> login() {
    return LibAppleAuthStoragePlatform.instance.login();
  }

  static Future<bool> storage(
    String uid,
    String? content,
    String salt,
  ) {
    String fileName = "${prefix_file}_${uid}_${salt}";
    return LibAppleAuthStoragePlatform.instance.storage(fileName, content);
  }

  static Future<String?> getStorageContent(String uid, String salt) {
    String fileName = "${prefix_file}_${uid}_${salt}";
    return LibAppleAuthStoragePlatform.instance.getStorageContent(fileName);
  }
}
